09. RViz Basics

RViz Basics

RViz

RViz stands for ROS Visualization. RViz is our one-stop tool to visualize all three core aspects of a robot: perception, decision-making, and actuation.

While Gazebo is a physics simulator, RViz can visualize any type of sensor data being published over a ROS topic: camera images, point clouds, ultrasonic measurements, lidar data, inertial measurements, and more. This data can be a live stream directly from the sensor or pre-recorded data stored as a bagfile .

You can also visualize live joint angle values from a robot and hence construct a real-time 3D representation of any robot. Having said that, RViz is not a simulator and does not interface with a physics engine. So RViz models neither collisions nor dynamics. RViz is not an alternative to Gazebo, but rather a complementary tool to keep an eye on every single process under the hood of a robotic system.

Running RViz

Since RViz is a ROS package, it requires roscore. In a terminal spin up roscore:

$ roscore

In another terminal, run rviz:

$ rosrun rviz rviz

“rviz” is a node located in an “rviz” package. Once launched, RViz should look something like this:

The empty window in the center is called 3D view . This is where you will spend most of your time observing the robot model, the sensors, and other meta-data.

The panel on the left is a list of loaded displays , while the one on the right shows different views available.

At the top we have a number of useful tools . The bottom bar displays information like time elapsed, frames per second, and some handy instructions for the selected tool.

Displays

For anything to appear in the 3D view , you first need to load a proper display. A display could be as simple as a basic 3D shape or a complex robot model.

Displays can also be used to visualize sensor data streams like 3D point clouds, lidar scans, or depth images.

RViz by default starts with two fixed property fields that cannot be removed: Global Options and Global Status . One governs simple global settings, while the other detects and displays useful status notifications.

For more information on RViz, check out their official guide here .